#pragma once

#include <ros/ros.h>
#include <tf/tf.h>
#include "task_custom_class.h"
#include "common_lib/log.h"
#include "common_lib/common.h"

namespace task
{
class CommandProcess;
class TaskProcess
{
public:
    TaskProcess(ros::NodeHandle &nh, ros::NodeHandle &private_nh);
    ~TaskProcess();

    void SetMapFile(std::string &map_file);
    void GetFirmwareInfo(std::vector<sFirmwareInfo> &firminfo);    
    void TaskInteract(sTaskMsg &path_info);

private:
    ros::NodeHandle nh_;
    ros::NodeHandle private_nh_;

    std::string map_file_;
    std::string vehicle_param_file_;
    std::string file_path_;

    // std::shared_ptr<task::CommandProcess> ptr_cmd_process_;
    // task::sAMRState amr_state_;
    task::sTaskReceive task_receive_;

    ros::Subscriber sub_control_;
    ros::Subscriber sub_control_state_;
    ros::Subscriber sub_actuator_;

    ros::Publisher pub_task_;

    ros::ServiceClient srv_client_path_info_;
    ros::ServiceClient srv_client_point_info_;
    ros::ServiceClient srv_client_map_info_;

    int local_host_task_cnt_ = 0;
    int local_host_task_times_ = 0;

    void Init();
    void LocalHostProcess();


    // void ControlCallback(const control_msgs::control_msgConstPtr &msg);
    // void ControlStateCallback(const control_msgs::control_state_msgConstPtr &msg);
    // void ActuatorCallback(const actuator_msgs::actuator_msgConstPtr &msg);

    // void StructMsgToRosMsg(task_msgs::task_msg &msg_ros, task::sTaskMsg &msg_struct);
public:
    // bool GetPathInofSrv(map_operation_msgs::GetPathInfoRequest &req, map_operation_msgs::GetPathInfoResponse &resp);
    // bool GetPathInofSrv(map_operation_msgs::GetPathInfo &srv);
    // bool GetPointInfoSrv(map_operation_msgs::GetPointInfoRequest &req, map_operation_msgs::GetPointInfoResponse &resp);
    // bool GetPointInfoSrv(map_operation_msgs::GetPointInfo &srv);
    // bool GetPointInfoSrv(std::string &pointid, sTaskPoint &point);

    // bool SetMapFile(std::string &map_file, );
};
}